Count Property (InfoStores Collection)
The Count
property returns the number of InfoStore objects in the collection. Read-only.
Syntax
objInfoStoresColl.Count
Data Type
Long
Example
This example
maintains a global variable as an index into the small collection, and uses the
Count property to check its validity:
' from InfoStores_NextItem
' iInfoStoresCollIndex is an integer used as an
index
' check for
empty collection...
' check index
upper bound
If
iInfoStoresCollIndex >= objInfoStoresColl.Count Then
iInfoStoresCollIndex = objInfoStoresColl.Count
MsgBox
"Already at end of InfoStores collection"
Exit
Function
End If
' index is
< count; can be incremented by 1
iInfoStoresCollIndex = iInfoStoresCollIndex + 1
Set
objInfoStore = objInfoStoresColl.Item(iInfoStoresCollIndex)
If
objInfoStore Is Nothing Then
MsgBox
"Error, cannot get this InfoStore object"
Exit
Function
Else
MsgBox
"Selected InfoStore " & iInfoStoresCollIndex
End If
See Also
InfoStore
Object